# !/usr/bin/python
# -*- coding: utf-8 -*-

import sys
from PySide6.QtCore import *
from PySide6.QtWidgets import QMainWindow, QApplication
from  demoui import Ui_MainWindow

import serial
import com
import data_devsta
import data_devmatain
import data_bitcfg
import data_devcfg
import data_usercfg
import data_devlog
import data_highspeed
import data_ota
import user_cfg


class MainForm(QMainWindow, Ui_MainWindow):
    def __init__(self):
        super(MainForm, self).__init__()
        self.cfg = user_cfg.jscfg()
        self.setupUi(self) #  QT designer 初始化UI
        self.com = com.SerThread(self, Ui_MainWindow)
        self.devsta = data_devsta.Devsta(self)
        self.devmatain = data_devmatain.Devmatain(self)
        self.bitcfg = data_bitcfg.Bitcfg(self)
        self.devcfg = data_devcfg.Devcfg(self)
        self.usercfg = data_usercfg.Usercfg(self)
        self.devlog = data_devlog.Devlog(self)
        self.highspeed = data_highspeed.c_highspeed(self)
        self.ota =  data_ota.Kota(self)
        # self.com._signal_update.connect(self.update_data)  # 绑定回调事件
        self.com.start()
        

if __name__ == "__main__":
    app = QApplication(sys.argv)
    win = MainForm()
    win.show()
    sys.exit(app.exec())

